package vivo;

/**
 * @Classname Solution_1
 * @Author happytaohaha
 * @Date 2020/3/8
 * @Description TODO
 */
public class Solution_1 {

    /**
     *
     * @param n int整型 第n天
     * @return int整型
     */
    public  static  int solution (int n) {
        if(n<=0){
            return 0;
        }
        int index = 1;
        int sum = 0;
        while (n > index){
            n = n -index;
            sum += index * index;
            index++;
        }
        for(int i = 0; i< n;i++){
            sum+=index;
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(solution(1));
    }
}
